#include"ShareMemory.h"
#include"SystemHead.h"
int main()
{
    pid_t pid=fork();
    if(pid<0)
    {
        perror("fork:");
        return -1;
    }
    if(pid==0)
    {
        ShMemory *shm=InitSharedMemory("./",10,1024);
        char temp[20]="helloword";
        WriteToSharedMenory(shm,temp,20);
    }
    else
    {
        wait(NULL);
        ShMemory *shm=InitSharedMemory("./",10,1024);
        char temp[20]={0};
        ReadFormSharedMenory(shm,temp,20);
        printf("read from child : %s\n",temp);
    }
}